<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="renderer" content="webkit">

    <title> hAdmin- 主页</title>

    <meta name="keywords" content="">
    <meta name="description" content="">

    <!--[if lt IE 9]>
    <meta http-equiv="refresh" content="0;ie.html" />
    <![endif]-->

    <link rel="shortcut icon" href="favicon.ico"> <link href="/Public/Admin/css/bootstrap.min.css?v=3.3.6" rel="stylesheet">
    <link href="/Public/Admin/css/font-awesome.min.css?v=4.4.0" rel="stylesheet">
    <link href="/Public/Admin/css/animate.css" rel="stylesheet">
    <link href="/Public/Admin/css/style.css?v=4.1.0" rel="stylesheet">
        <!-- 百度编辑器 -->
    <script type="text/javascript" charset="utf-8" src="/Public/ueditor/ueditor.config.js"></script>
    <script type="text/javascript" charset="utf-8" src="/Public/ueditor/ueditor.all.min.js"> </script>
</head>

<body class="fixed-sidebar full-height-layout gray-bg" style="overflow:hidden">
    <div id="wrapper">
        <!--左侧导航开始-->
        <nav class="navbar-default navbar-static-side" role="navigation">
            <div class="nav-close"><i class="fa fa-times-circle"></i>
            </div>
            <div class="sidebar-collapse">
                <ul class="nav" id="side-menu">
                    <li class="nav-header">
                        <div class="dropdown profile-element">
                            <a data-toggle="dropdown" class="dropdown-toggle" href="#">
                                <span class="clear">
                                    <span class="block m-t-xs" style="font-size:20px;">
                                        <i class="fa fa-area-chart"></i>
                                        <strong class="font-bold">后台管理</strong>
                                    </span>
                                </span>
                            </a>
                        </div>
                        <div class="logo-element"><i class="fa fa-area-chart"></i>
                        </div>
                    </li>
                    <!-- 
	                    <li class="hidden-folded padder m-t m-b-sm text-muted text-xs">
	                        <span class="ng-scope">Menu</span>
	                    </li> 
                    -->
                    
                    <li>
                        <a class="J_menuItem" href="<?php echo U('Index/index');?>">
                            <i class="fa fa-home"></i>
                            <span class="nav-label">主页</span>
                        </a>
                    </li>
                    <?php if(is_array($menu)): $i = 0; $__LIST__ = $menu;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i;?><li>
	                        <a href="#">
	                            <i class="fa fa fa-bar-chart-o"></i>
	                            <span class="nav-label"><?php echo ($vo["title"]); ?></span>
	                            <span class="fa arrow"></span>
	                        </a>
	                        <ul class="nav nav-second-level">
	                            <?php if(is_array($vo['_data'])): $i = 0; $__LIST__ = $vo['_data'];if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vvo): $mod = ($i % 2 );++$i;?><li>
		                                <a class="J_menuItem" href="<?php echo U($vvo['url']);?>"><?php echo ($vvo['title']); ?></a>
		                            </li><?php endforeach; endif; else: echo "" ;endif; ?>
	                        </ul>
	                    </li><?php endforeach; endif; else: echo "" ;endif; ?>
                </ul>
            </div>
        </nav>
        <!--左侧导航结束-->
        <!--右侧部分开始-->
        <div id="page-wrapper" class="gray-bg dashbard-1">
            <div class="row border-bottom">
                <nav class="navbar navbar-static-top" role="navigation" style="margin-bottom: 0">
                    <div class="navbar-header">
                       <a class="navbar-minimalize minimalize-styl-2 btn btn-info " href="#"><i class="fa fa-bars"></i> </a>
                    </div>
                    <ul class="nav navbar-top-links navbar-right">
                        <li class="dropdown">
                            <a class="dropdown-toggle count-info" onclick="outLogin()">
                               <span class="glyphicon glyphicon-off" aria-hidden="true"></span>
                               <!-- <i class="fa fa-envelope"></i> <span class="label label-warning">16</span>-->
                                <!--layer弹框-->
							    <script src="/Public/layer/layer.js"></script>
							    <script>
							    
							     function outLogin(){
							           $.ajax({
							            url     :"<?php echo U('Login/outLogin');?>",
							            dataType:'json',
							            success :function(res){
							                if(res.status == 1){
							                	layer.msg(res.info,{time:2000},function(){ 
							                       location.href  = "<?php echo U('Login/index');?>";
							                    });
							                }
							            }
							           })
							     }
							       
							    </script>
                            </a>
                        </li>
                        <!--
                        <li class="dropdown">
                            <a class="dropdown-toggle count-info" data-toggle="dropdown" href="#">
                                <i class="fa fa-bell"></i> <span class="label label-primary">8</span>
                            </a>
                        </li>
                        -->
                    </ul>
                </nav>
            </div>
            <div class="row J_mainContent" id="content-main" style="overflow-Y:scroll;">
              
<div class="row">
            <div class="col-sm-12">
                <div class="ibox float-e-margins">
                    <div class="ibox-title">
                        <a href="javascript:;" onclick="addShow(0)"><h5><i class="glyphicon glyphicon-plus" aria-hidden="true"></i>添加轮播</h5></a>
                    </div>
                    <div class="ibox-content">
                        <div class="table-responsive">
                            <table class="table table-striped">
                                <thead>
                                    <tr>

                                        <th></th>
                                        <th>图片</th>
                                        <th>标题</th>
                                        <th>地址</th>
                                        <th>排序</th>
                                        <th>操作</th>
                                    </tr>
                                </thead>
                                <tbody>
                                   <?php if(is_array($list)): $i = 0; $__LIST__ = $list;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i;?><tr>
                                        <td>
                                            <div class="icheckbox_square-green checked" style="position: relative;"><input type="checkbox" checked="" class="i-checks" name="input[]" style="position: absolute; opacity: 0;"><ins class="iCheck-helper" style="position: absolute; top: 0%; left: 0%; display: block; width: 100%; height: 100%; margin: 0px; padding: 0px; background: rgb(255, 255, 255); border: 0px; opacity: 0;"></ins></div>
                                        </td>
                                        <td><img src="<?php echo ($vo["pic"]); ?>" width="150px" height="80px" alt=""></td>
                                        <td><?php echo ($vo['title']); ?></td>
                                        <td><?php echo ($vo['url']); ?></td>
                                        <td><?php echo ($vo['sort']); ?></td>
                                        <td>
                                            <a href="javascript:;" onclick="editAlert(<?php echo ($vo['banner_id']); ?>)" title="修改" style="margin-right:10px"><i class="glyphicon glyphicon-edit"></i></a>
                                            <a href="<?php echo U('Banner/del',array('banner_id'=>$vo['banner_id']));?>"   title="删除"><i class="glyphicon glyphicon-trash"></i></a>
                                        </td>
                                    </tr><?php endforeach; endif; else: echo "" ;endif; ?>
                                </tbody>
                            </table>
                             <div class="page1">
                                <?php echo ($show); ?>
                              </div>
                        </div>

                    </div>
                </div>
            </div>

        </div>
        <!-- 添加弹出框开始 -->
        <div id="AddAlert" style="display:none;position:absolute;left:0px;top:0px;z-index:9999;background:rgba(198,198,198,0.5);width:100%;height:100%">
          <div class="col-sm-6" style="margin-left:470px;margin-top:270px">
                  <div class="ibox float-e-margins">
                      <div class="ibox-title">
                          <h5>添加菜单</h5>
                          <div class="ibox-tools">
                              <a class="close-link" onclick="addClose()">
                                  <i class="fa fa-times"></i>
                              </a>
                          </div>
                      </div>
                      <div class="ibox-content">
                          <div class="row">
                              <div class="col-sm-12">
                                  <form role="form" action="<?php echo U('Banner/add');?>" method="post" enctype ="multipart/form-data">
                                      <div class="form-group">
                                          <label>标题</label>
                                          <input type="text"  name="title" class="form-control">
                                      </div>
                                      <div class="form-group">
                                          <label>图片（410*430）</label>
                                          <input type="file"  name="pic" >
                                      </div>
                                      <div class="form-group">
                                          <label>排序</label>
                                          <input type="text"  name="sort" class="form-control">
                                      </div>
                                      <div class="form-group">
                                          <label>地址（可选）</label>
                                          <input type="text"  name="url" class="form-control">
                                      </div>
                                      <div class="form-group">
                                          <label>是否显示</label>
                                          <input type="radio"  name="status" value="1"  checked>显示
                                          <input type="radio"  name="status" value="2" >不显示
                                      </div>
                                      <div>
                                          <button class="btn btn-sm btn-primary pull-right m-t-n-xs" type="submit" style="margin-right:450px">
                                             <strong>添加</strong>
                                          </button>
                                          
                                      </div>
                                  </form>
                              </div>
                          </div>
                      </div>
                  </div>
              </div>
            </div>
        <!-- 添加弹出框结束 -->
        
        <!-- 修改弹出框开始 -->
        <div id="editAlert" style="display:none;position:absolute;left:0px;top:0px;z-index:9999;background:rgba(198,198,198,0.5);width:100%;height:100%">
          <div class="col-sm-6" style="margin-left:470px;margin-top:270px">
                  <div class="ibox float-e-margins">
                      <div class="ibox-title">
                          <h5>修改菜单</h5>
                          <div class="ibox-tools">
                              <a class="close-link" onclick="editClose()">
                                  <i class="fa fa-times"></i>
                              </a>
                          </div>
                      </div>
                      <div class="ibox-content">
                          <div class="row">
                              <div class="col-sm-12">
                                  <form role="form" action="<?php echo U('Banner/edit');?>" method="post" enctype ="multipart/form-data">
                                      <input type="hidden" name="banner_id" >
                                      <div class="form-group">
                                          <label>标题</label>
                                          <input type="text"  name="title" class="form-control">
                                      </div>
                                      
                                      <div class="form-group">
                                          <label>图片（410*430）</label>
                                          <input type="hidden"  name="pic" >
                                          <input type="file" name="file">
                                      </div>
                                      <div class="form-group">
                                          <img src="" alt="" width="150px" height="80px">
                                      </div>
                                      <div class="form-group">
                                          <label>排序</label>
                                          <input type="text"  name="sort" class="form-control">
                                      </div>
                                      <div class="form-group">
                                          <label>地址（可选）</label>
                                          <input type="text"  name="url" class="form-control">
                                      </div>
                                      <div class="form-group">
                                          <label>是否显示</label>
                                          <input type="radio"  name="status" value="1"  checked>显示
                                          <input type="radio"  name="status" value="2" >不显示
                                      </div>
                                      <div>
                                          <button class="btn btn-sm btn-primary pull-right m-t-n-xs" type="submit" style="margin-right:450px">
                                             <strong>添加</strong>
                                          </button>
                                          
                                      </div>
                                  </form>
                              </div>
                          </div>
                      </div>
                  </div>
              </div>
            </div>
        <!-- 修改弹出框结束 -->
        <script>
            function addShow(pid){
              $("#AddAlert input[name='parent_id']").val(pid);
              $("#AddAlert").css("display","block");
            }
            function addClose(){
              $("#AddAlert").css("display","none");
            }
            function delAlert(id){
              layer.confirm('确认删除', {
                  btn: ['确定','取消'] //按钮
                }, function(){
                  var str = "<?php echo U('Power/delpower',array('id'=>seatId));?>";
                  var url = str.replace("seatId",id)
                  location.href = url;
                }, function(){
                  
                });
            }
            function editClose(){
              $("#editAlert").css("display","none");
            }
            function editAlert(id){
              $("#editAlert").css("display","block");
           
              $.ajax({
                url: "<?php echo U('Banner/info');?>",
                data:{banner_id:id},
                type:"post",
                dataType:'json',
                success:function(res){
                    $("#editAlert img").attr('src',res.pic);
                    $("#editAlert input[name='banner_id']").val(res.banner_id);
                    $("#editAlert input[name='pic']").val(res.pic);
                    $("#editAlert input[name='sort']").val(res.sort);
                    $("#editAlert input[name='status']").val(res.status);
                    $("#editAlert input[name='url']").val(res.url);
                    $("#editAlert input[name='title']").val(res.title);
                },
              })
            }
        </script>

            </div>
        </div>
        <!--右侧部分结束-->
    </div>

    <!-- 全局js -->
    <script src="/Public/Admin/js/jquery.min.js?v=2.1.4"></script>
    <script src="/Public/Admin/js/bootstrap.min.js?v=3.3.6"></script>
    <script src="/Public/Admin/js/plugins/metisMenu/jquery.metisMenu.js"></script>
    <script src="/Public/Admin/js/plugins/slimscroll/jquery.slimscroll.min.js"></script>
    <script src="/Public/Admin/js/plugins/layer/layer.min.js"></script>

    <!-- 自定义js -->
    <script src="/Public/Admin/js/hAdmin.js?v=4.1.0"></script>
    <script type="text/javascript" src="/Public/Admin/js/index.js"></script>

    <!-- 第三方插件 -->
    <script src="/Public/Admin/js/plugins/pace/pace.min.js"></script>

</body>

</html>